home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 242 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: cleveland.Freenet.Edu!gk851
  2. From: gk851@cleveland.Freenet.Edu (Tim B. Wendt)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Raycasting question
  5. Date: 5 Jan 1996 05:00:21 GMT
  6. Organization: Case Western Reserve University, Cleveland OH (USA)
  7. Message-ID: <4cib95$o2n@madeline.INS.CWRU.Edu>
  8. NNTP-Posting-Host: kanga.ins.cwru.edu
  9.  
  10.  
  11. Help, I'm stuck.  Here is where I'm at...
  12.  
  13. * Find the players new position and view angle
  14. * I traverse my 2D BSP tree and create a sorted polygon (wall) list
  15. * I rotate the wall's endpoints around such that the center of the
  16.    player's field of view is along the y-axis
  17. * Cast a ray for each column on the screen
  18.  
  19. Here's my question.  I want to test a ray against each wall in the
  20. wall list.  If it intersects calculate the intersection point (xi,yi)
  21. between the wall and the ray.  Then use yi as the distance for scaling
  22. the height of the wall.  How do I calculate (xi,yi) using only a angle
  23. (ray) and the endpoints of the wall?
  24.  
  25. I use an intersection routine in when spliting walls while creating
  26. the BSP tree but that equation doesn't seem applicable here.  
  27.  
  28. Please post to newsgroup because I'm using a temporary email account
  29. and I can't always recieve mail.  Thanks!
  30.  
  31. Tim Wendt
  32. -- 
  33. -----------------------------------------------------
  34. - "Hmmm...beer!" -  Homer Simpson -------------------
  35. ---------------------------------- Tim Wendt --------
  36. - tim.wendt@daytonoh.ncr.com ----- A1200/030 --------
  37.